import 'package:appflutterhomeschool/common/common.dart';
import 'package:appflutterhomeschool/route/application.dart';
import 'package:appflutterhomeschool/route/routes.dart';
import 'package:flutter/cupertino.dart';

///用户： ninetailedfox
///时间： 2020/6/26
///邮箱： 1037438704@qq.com
///功能： 设置页面的状态管理

class SetUpViewModel extends ChangeNotifier {
  BuildContext me;

  SetUpViewModel(this.me);


  String getPhone = "";

  initView() {
    getPhone = Constant.getPhone().substring(0,3)+"****"+Constant.getPhone().substring(Constant.getPhone().length-4,Constant.getPhone().length);
  }

  initEvent(int tag) {
    switch (tag) {
      case 0:
        //个人资料
        Application().navigatePushToPage(me, Routes.personalDataPage, {});
        break;
      case 1:
        //修改密码
        Application().navigatePushToPage(me, Routes.changePasswordPage, {});
        break;
      case 2:
        //修改绑定手机号
        Application()
            .navigatePushToPage(me, Routes.registerPage, {"pageTag": 3}).then((value) {
          initView();
        });
        break;
      case 3:
        //关于我们
        Application().navigatePushToPage(me, Routes.aboutUsPage, {});
        break;
    }
  }
}
